package com.wuchao.spring.aopPlus.point;

import com.wuchao.spring.aopPlus.ioc.TheIoc;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Scanner;

/**
 * @Author wuchao66
 * @Date 2022/9/27 16:12
 * @PackageName:com.wuchao.spring.aopPlus.point
 * @ClassName: ThePoint
 * @Description: TODO
 * @Param
 * @Version 1.0
 */
@Slf4j
@Service("ThePoint")
public class ThePoint {//切入点--别写入参版注解切入点
    @Autowired//自动注入
    private TheIoc theIoc;
    public void show() throws RuntimeException{
        theIoc.show();
        log.info("我是注解版aop的切入点");
        log.info("请输入一个数字");
        int num=(new Scanner(System.in)).nextInt();
        if(num==151){
            throw  new RuntimeException("我主动报错");
        }
    }
}
